package model;

import java.io.Serializable;

public class Message implements Serializable
{

	private static final long serialVersionUID = -5914858287803918688L;

	private MessageType type;
	private String text;
	private String to;
	private String from;

	public Message(final MessageType type)
	{
		this(type, "", null, null);
	}
	
	public Message(final MessageType type, final String text)
	{
		this(type, text, null, null);
	}
	
	public Message(final MessageType type, final String text, final String to)
	{
		this(type, text, to, null);
	}
	
	public Message(final MessageType type, final String text, final String to, final String from)
	{
		this.type = type;
		this.text = text;
		this.to = to;
		this.from = from;
	}
	
	@Override
	public String toString()
	{
		return "Message [type=" + type + ", text=" + text + ", to=" + to + ", from=" + from + "]";
	}

	public String getFrom()
	{
		return from;
	}

	public void setFrom(String from)
	{
		this.from = from;
	}

	public MessageType getType()
	{
		return type;
	}

	public String getText()
	{
		return text;
	}

	public String getTo()
	{
		return to;
	}
}
